
*12345678901234567890123456789012345678901234567890123456789012345678901234567890
capture log close
clear all
set more off

*	************************************************************************
* 	File-Name: 	Rosenberg_et_al_analysis_code.do
*	Date:  		10/24/2019
*	Author: 	Meital Rosenberg, Daniel Armanios, Michaël Aklin, Paulina
*				Jaramillo
*	Data Used:  ACCESS-1
*	Purpose:   	.do file to replicate the results of:
* 
*				Meital Rosenberg, Daniel Armanios, Michaël Aklin, Paulina
*				Jaramillo. 2019. "Evidence of Gender Inequality in Energy Use 
*				from a Mixed Methods Study in India" Nature Sustainability.
*
*				To use this file: 
*				(1) Download the ACCESS-1 data at (RawDataHH.dta) at: 
*						doi:10.7910/DVN/0NV9LF
*					and save it in the same folder as the replication package.
*
*				(2) Download this replication package. 
*				after having downloaded the replication
*				package, please change the path the work directory (flagged
*				below). 
*	************************************************************************

*	************************************************************************
*	1. Get the ACCESS data (from Aklin et al. 2016).
*	************************************************************************

*	1. Working directory. *** ADAPT THE PATH TO THE REPLICATION FOLDER ****
cd "PATH_TO_REPLICATION_PACKAGE"

*	2. Data. NOTE: you need to download this dataset from doi:10.7910/DVN/0NV9LF
*	before you can run this file!

use "./RawDataHH.dta", clear

*	************************************************************************
*	2. Code new variables (separate file). 
*	
*	Generates new variables and a dataset that can be used for the R file.
*	************************************************************************

quiet do "./Rosenberg_et_al_dataprocessing_code.do"



*	************************************************************************
*	3. Replication of the main results
*	************************************************************************

*	************************************************************************
*	Table 1
*	************************************************************************

*	Panel A: grid (yes or no)
reg gender_male_total2 m2_q55_grid, vce(cluster m1_q10_subdistrict_code)
reg gender_female_total2 m2_q55_grid, vce(cluster m1_q10_subdistrict_code)

reg gender_male_total2 m2_q55_grid, vce(cluster m1_q9_district_code)
reg gender_female_total2 m2_q55_grid, vce(cluster m1_q9_district_code)

reg gender_male_total2 m2_q55_grid i.m1_q10_subdistrict_code, vce(cluster m1_q10_subdistrict_code)
reg gender_female_total2 m2_q55_grid i.m1_q10_subdistrict_code, vce(cluster m1_q10_subdistrict_code)

reg gender_male_total2 m2_q55_grid i.m1_q9_district_code, vce(cluster m1_q9_district_code)
reg gender_female_total2 m2_q55_grid i.m1_q9_district_code, vce(cluster m1_q9_district_code)

*	Panel B: years of electricity
reg gender_male_total2 m2_q55_1_grid_years2, vce(cluster m1_q10_subdistrict_code)
reg gender_female_total2 m2_q55_1_grid_years2, vce(cluster m1_q10_subdistrict_code)

reg gender_male_total2 m2_q55_1_grid_years2, vce(cluster m1_q9_district_code)
reg gender_female_total2 m2_q55_1_grid_years2, vce(cluster m1_q9_district_code)

reg gender_male_total2 m2_q55_1_grid_years2 i.m1_q10_subdistrict_code, vce(cluster m1_q10_subdistrict_code)
reg gender_female_total2 m2_q55_1_grid_years2 i.m1_q10_subdistrict_code, vce(cluster m1_q10_subdistrict_code)

reg gender_male_total2 m2_q55_1_grid_years2 i.m1_q9_district_code, vce(cluster m1_q9_district_code)
reg gender_female_total2 m2_q55_1_grid_years2 i.m1_q9_district_code, vce(cluster m1_q9_district_code)

*	Panel C: any electricity
reg gender_male_total2 m2_q68_elec, vce(cluster m1_q10_subdistrict_code)
reg gender_female_total2 m2_q68_elec, vce(cluster m1_q10_subdistrict_code)

reg gender_male_total2 m2_q68_elec, vce(cluster m1_q9_district_code)
reg gender_female_total2 m2_q68_elec, vce(cluster m1_q9_district_code)

reg gender_male_total2 m2_q68_elec i.m1_q10_subdistrict_code, vce(cluster m1_q10_subdistrict_code)
reg gender_female_total2 m2_q68_elec i.m1_q10_subdistrict_code, vce(cluster m1_q10_subdistrict_code)

reg gender_male_total2 m2_q68_elec i.m1_q9_district_code, vce(cluster m1_q9_district_code)
reg gender_female_total2 m2_q68_elec i.m1_q9_district_code, vce(cluster m1_q9_district_code)


*	************************************************************************
*	Table 2
*	************************************************************************

*	Panel A
reg total_lightsfans female kitchen femalekitchen_interact , vce(cluster m1_q10_subdistrict_code)
reg total_lightsfans female kitchen femalekitchen_interact , vce(cluster m1_q9_district_code)
reg total_lightsfans female kitchen femalekitchen_interact i.m1_q10_subdistrict_code, vce(cluster m1_q10_subdistrict_code)
reg total_lightsfans female kitchen femalekitchen_interact i.m1_q9_district_code, vce(cluster m1_q9_district_code)

*	Panel B
reg total_lightsfans female kitchen femalekitchen_interact if m1_q30_no_children_school>0 & m1_q30_no_children_school != ., vce(cluster m1_q10_subdistrict_code)
reg total_lightsfans female kitchen femalekitchen_interact if m1_q30_no_children_school>0 & m1_q30_no_children_school != ., vce(cluster m1_q9_district_code)
reg total_lightsfans female kitchen femalekitchen_interact i.m1_q10_subdistrict_code if m1_q30_no_children_school>0 & m1_q30_no_children_school != ., vce(cluster m1_q10_subdistrict_code)
reg total_lightsfans female kitchen femalekitchen_interact i.m1_q9_district_code if m1_q30_no_children_school>0 & m1_q30_no_children_school != ., vce(cluster m1_q9_district_code)

*	Panel C
reg total_lightsfans woman_hhhead kitchen womanheadkitchen_interact, vce(cluster m1_q10_subdistrict_code)
reg total_lightsfans woman_hhhead kitchen womanheadkitchen_interact, vce(cluster m1_q9_district_code)
reg total_lightsfans woman_hhhead kitchen womanheadkitchen_interact i.m1_q10_subdistrict_code, vce(cluster m1_q10_subdistrict_code)
reg total_lightsfans woman_hhhead kitchen womanheadkitchen_interact i.m1_q9_district_code, vce(cluster m1_q9_district_code)

*	Panel D
reg total_lightsfans woman_hhhead kitchen womanheadkitchen_interact if m1_q30_no_children_school>0 & m1_q30_no_children_school != ., vce(cluster m1_q10_subdistrict_code)
reg total_lightsfans woman_hhhead kitchen womanheadkitchen_interact if m1_q30_no_children_school>0 & m1_q30_no_children_school != ., vce(cluster m1_q9_district_code)
reg total_lightsfans woman_hhhead kitchen womanheadkitchen_interact i.m1_q10_subdistrict_code if m1_q30_no_children_school>0 & m1_q30_no_children_school != ., vce(cluster m1_q10_subdistrict_code)
reg total_lightsfans woman_hhhead kitchen womanheadkitchen_interact i.m1_q9_district_code if m1_q30_no_children_school>0 & m1_q30_no_children_school != ., vce(cluster m1_q9_district_code)


*	************************************************************************
*	Figure 2
*	************************************************************************

*	Graphing the nonlinear effect of years
reg gender_female_total2 i.m2_q55_1_grid_years_cat, r
	est store female
reg gender_male_total2 i.m2_q55_1_grid_years_cat, r
	est store male
coefplot (female, label("Female")) (male, label("Male"))	///
	, drop(_cons) xline(0) xtitle("Number of Appliances")
eststo clear



*	************************************************************************
*	Supplementary material
*	************************************************************************

*	************************************************************************
*	More Male-and Female-Used Appliance counts by Household Electrification
*	with Additional Controls
*	************************************************************************

reg gender_male_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu, r
reg gender_female_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu, r

reg gender_male_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu, cluster(m1_q9_district_code)
reg gender_female_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu, cluster(m1_q9_district_code)

reg gender_male_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu, cluster(m1_q10_subdistrict_code)
reg gender_female_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu, cluster(m1_q10_subdistrict_code)

reg gender_male_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu i.m1_q9_district_code, cluster(m1_q9_district_code)
reg gender_female_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu i.m1_q9_district_code, cluster(m1_q9_district_code)

reg gender_male_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu i.m1_q10_subdistrict_code, cluster(m1_q10_subdistrict_code)
reg gender_female_total2 m2_q55_grid m1_q43_no_rooms m1_q27_no_adults m1_q29_no_children m1_q30_no_children_school logexp m1_q23_edu i.m1_q10_subdistrict_code, cluster(m1_q10_subdistrict_code)


*	************************************************************************
*	Sensitivity Analysis of Effects of Grid Electricity on More Male vs. 
*	Female-Used Appliance Counts
*	************************************************************************

reg gender_male_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=1
reg gender_female_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=1

reg gender_male_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=2
reg gender_female_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=2

reg gender_male_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=3
reg gender_female_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=3

reg gender_male_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=4
reg gender_female_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=4

reg gender_male_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=5
reg gender_female_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=5

reg gender_male_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=10
reg gender_female_total2 m2_q55_grid i.m1_q10_subdistrict_code if m2_q55_1_grid_years2<=10

reg gender_male_total2 m2_q55_grid i.m1_q10_subdistrict_code
reg gender_female_total2 m2_q55_grid i.m1_q10_subdistrict_code
